--Classe pour simuler les actions lorsque l'algo n'est pas en production                        
Simulate = {}

function Simulate:passe(simulation)
   return (true)
end

function Simulate:acheter(simulation, n)
   if (n > 0) and (Calcul:isPossibleBuy(n, Anal.current, Anal.money)) then
      simulation.nb_action = simulation.nb_action + n
      simulation.money = simulation.money  - ((n * Anal.current) + (Calcul:getPourcentage(n, Anal.current)))
      return (true)
   end
   return (Simulate:passe(simulation))
end

function Simulate:vendre(simulation, n)
   if (n > 0) and (n <= Anal.nb_action) then
      simulation.nb_action = simulation.nb_action - n
      simulation.money = simulation.money + (n * Anal.current) - (Calcul:getPourcentage(n, Anal.current))
      return (true)
   end
   return (Simulate:passe(simulation))
end